﻿#ifndef INFOADMIN_H
#define INFOADMIN_H
#include <QVector>
#include "infoperson.h"
#include "managementadmin.h"
#include "infostudent.h"
#include "infoteacher.h"
#include "infocourse.h"

//管理员信息 专门写了一个类 这个类继承与人的信息和后面的管理
class adminInfo:public personInfo,public adminManagement
{
public:
    adminInfo();
    //已实现
    void setInfo(QString name,QString id,QString password);

    int whoAreYou(QString id);

    QList<courseInfo>& getWaitToLoadCourse();

    QStringList getAllInfo();
    //实例化接口

    //把相关信息显示到表格
    virtual void displayAllStudent(QStandardItemModel *model);

    virtual void displayAllTeacher(QStandardItemModel *model);

    virtual void displayAllCourse(QStandardItemModel *model);

    virtual void checkMyInfo(QStandardItemModel *model);

    virtual bool displayCourseWithId(const QString& id,QStandardItemModel *model);

    virtual bool displayCourseWithName(const QString& name,QStandardItemModel *model);

    virtual bool displayTeacherWithId(const QString& id,QStandardItemModel *model);

    virtual bool displayTeacherWithName(const QString& name,QStandardItemModel *model);

    virtual bool displayStudentWithId(const QString& id,QStandardItemModel *model);

    virtual bool displayStudentWithName(const QString& name,QStandardItemModel *model);

    virtual void displayWaitToLoadCourse(QStandardItemModel *model);

    //添加相关信息
    virtual void addNewCourse(courseInfo& newCourse);

    virtual void addNewStudent(studentInfo& newStudent);

    virtual void addNewTeacher(teacherInfo& newTeacher);

    //修改密码
    virtual bool modifyPassword(QString oldPassword,QString newPassword);

    //修改相关信息
    virtual void modifyStudentInfo(studentInfo& info,QStringList newInfo);

    virtual void modifyCourseInfo(courseInfo& info,QStringList newInfo);

    virtual void modifyTeacherInfo(teacherInfo& info,QStringList newInfo);

    //删除相关信息
    virtual void deleteStudentInfo(QString id);

    virtual void deleteTeacherInfo(QString id);

    virtual void deleteCourseInfo(QString id);

    //查找相关信息
    virtual teacherInfo& findTeacherWithId(const QString& id);

    virtual teacherInfo& findTeacherWithName(const QString& name);

    virtual studentInfo& findStudentWithId(const QString& id);

    virtual studentInfo& findStudentWithName(const QString& name);

    virtual courseInfo& findCourseWithId(const QString &id);

    //保存文件
    virtual void saveAllInfo();

private:
    QList<studentInfo> stuInfo;
    QList<teacherInfo> teaInfo;
    QList<courseInfo> couInfo;
    QList<courseInfo> waitToLoadCourse;
    QString adminPassword;

};


#endif // INFOADMIN_H
